package com.demo2do.fms.admin.service.authority;

import java.util.List;
import java.util.Map;

import com.demo2do.fms.admin.service.DataService;
import com.demo2do.fms.entity.authority.Role;
import com.demo2do.fms.entity.authority.RoleTemplate;

/**
 * 
 * @author Ysy
 *
 */
public interface RoleService extends DataService<Role>{
    
    /**
     * list all the available roles mapped by role code
     * 
     * @return
     */
    public Map<String, Role> list();
    
    /**
     * list role by role_templates
     * 
     * @param templates
     * @return
     */
    public List<Role> list(List<RoleTemplate> templates);
    
    /**
     * count role by role_template
     * 
     * @param template
     * @return
     */
    public int count(RoleTemplate template);
    
    /**
     * 
     * @param roleName
     * @return
     */
    public Boolean exsitName(String roleName);
    
    /**
     * 
     * @param role
     * @param menuNames
     */
    public void create(Role role, List<String> menuNames);
    
    /**
     * 
     * @param role
     */
    public void disable(Role role);
    
}
